<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{% block title %}{% endblock %} | 后台管理系统</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="shortcut icon" href="{% static "images/favicon.ico" %}"/>
    <link rel="stylesheet" href="{% static 'adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{% static 'adminlte/bower_components/font-awesome/css/font-awesome.min.css' %}">
    <link rel="stylesheet" href="{% static 'adminlte/dist/css/AdminLTE.min.css' %}">
    <link rel="stylesheet" href="{% static 'adminlte/dist/css/skins/_all-skins.min.css' %}">
    <link rel="stylesheet" href="{% static 'sweetalert/sweetalert.css' %}">
    <script src="{% static 'adminlte/bower_components/jquery/dist/jquery.min.js' %}"></script>
    <script src="{% static 'adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
    <script src="{% static 'adminlte/dist/js/adminlte.min.js' %}"></script>
    <script src="{% static 'sweetalert/sweetalert.min.js' %}"></script>
    <script src="{% static 'sweetalert/xfzalert.js' %}"></script>
    <script src="{% static 'js/xfzajax.js' %}"></script>
    <script src="{% static 'js/message.js' %}"></script>
    <script src="{% static 'js/cms_base.js' %}"></script>
{% block head %}{% endblock %}

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="{% url 'cms:index' %}" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>CMS</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg">后台管理</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531164611306&di=0359af64fee74589cf8d34fcb8db45ec&imgtype=0&src=http%3A%2F%2Fmvimg1.meitudata.com%2F54e56071c7a8b7322.jpg" class="user-image" alt="User Image">
                            <span class="hidden-xs">{{ user.username }}</span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- User image -->
                            <li class="user-header">
                                <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1531164611306&di=0359af64fee74589cf8d34fcb8db45ec&imgtype=0&src=http%3A%2F%2Fmvimg1.meitudata.com%2F54e56071c7a8b7322.jpg" class="img-circle" alt="User Image">

                                <p>
                                    {{ user.username }}
                                    <small>Python web开发工程师</small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a href="{% url 'cms:user_center' %}" class="btn btn-default btn-flat">个人中心</a>
                                </div>
                                <div class="pull-right">
                                    <a href="{% url 'xfzauth:logout' %}" class="btn btn-default btn-flat">退出登录</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <aside class="main-sidebar">
        <section class="sidebar">
            <form action="#" method="get" class="sidebar-form">
                <div class="input-group">
                    <input type="text" name="q" class="form-control" placeholder="搜索...">
                    <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
                </div>
            </form>
            <ul class="sidebar-menu" data-widget="tree">
                <li>
                    <a href="{% url 'news:index' %}">
                        <i class="fa fa-mail-reply-all"></i>
                        <span>返回网站首页</span>
                    </a>
                    <a href="{% url 'cms:index' %}">
                        <i class="fa fa-home"></i>
                        <span>cms首页</span>
                    </a>
                </li>
                {# 根据用户权限显示对应的页面 #}
                {% if perms.news.change_news %}
                    <li class="header">文章管理</li>
                    <li>
                        <a href="{% url 'cms:news_list' %}">
                            <i class="fa fa-list">
                                <span>文章列表</span>
                            </i>
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'cms:write_news' %}">
                            <i class="fa fa-edit"></i>
                            <span>发布文章</span>
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'cms:news_category' %}">
                            <i class="fa fa-tag"></i>
                            <span>文章分类</span>
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'cms:banners' %}">
                            <i class="fa fa-picture-o">
                                <span>轮播图管理</span>
                            </i>
                        </a>
                    </li>
                {% endif %}
                {% if perms.course.change_course %}
                    <li class="header">课程资讯管理</li>
                    <li><a href="{% url 'cms:pub_course' %}">
                    <i class="fa fa-tv">
                        <span>发布课程资讯</span>
                    </i>
                </a></li>
                    <li>
                        <a href="{% url 'cms:course_category' %}">
                            <i class="fa fa-tag"></i>
                            <span>课程资讯分类</span>
                        </a>
                    </li>

                {% endif %}
                {% if user.is_superuser %}
                    <li class="header">人员管理</li>
                    <li>
                        <a href="{% url 'cms:staffs' %}">
                            <i class="fa fa-group"></i>
                            <span>用户管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'cms:course_teacher' %}">
                            <i class="fa fa-cog"></i>
                            <span>教师管理</span>
                        </a>
                    </li>
                {% endif %}
                {% if user.is_superuser %}
                    <li class="header">资料管理</li>
                    <li>
                    <a href="{% url 'cms:payinfo_list' %}">
                        <i class="fa fa-folder"></i>
                        <span>资料列表</span>
                    </a>
                    </li>
                    <li>
{#                    <a href="{% url 'cms:pub_payinfo' %}">#}
                    <a href="#">
                        <i class="fa fa-leanpub"></i>
                        <span>发布资料</span>
                    </a>
                    </li>
                {% endif %}
            </ul>
        </section>
    </aside>

    <div class="content-wrapper">
        <section class="content-header">
            {% block content-header %}{% endblock %}
        </section>

        <section class="content">
            {% block content %}{% endblock %}
        </section>
    </div>

    <footer class="main-footer">
        CMS后台管理
    </footer>
</div>
</body>
</html>
